package data.preprocessing;

import java.util.ArrayList;

/**
 * Creates a list of StringProcessor and applies this list to a String
 * @author guillaumes
 *
 */
public class StringProcessor_FromStringProcessors implements StringProcessor 
{
	protected ArrayList<StringProcessor> list;
	
	public StringProcessor_FromStringProcessors()
	{
		list=new ArrayList<StringProcessor>();
	}
	
	public void add(StringProcessor p)
	{
		list.add(p);
	}
	
	public String map(String from) {
		String retour=from;
		for(int i=0;i<list.size();i++)
		{
			retour=list.get(i).map(retour);
		}
//		System.out.println(" all:"+retour);
		return(retour);		
	}
}
